/*************************************************************************
    > File Name: myfile.c
    > Author: ma6174
    > Mail: ma6174@163.com 
    > Created Time: Fri 31 Oct 2025 03:40:35 PM CST
 ************************************************************************/

#include<stdio.h>


int main()
{
    FILE *fp = fopen("log.txt", "w");
    if(fp == NULL)
    {
        perror("fopen");
        return 1;
    }

    const char *message = "hello file\n";
    int i = 0;
    while(i < 10)
    {
        fputs(message, fp);
        i++;
    }

    fclose(fp);
    return 0;
}



